package com.dy.domain.pojo;

public class Result {

    private boolean flag;//请求是否成功标识
    private String message;//提示信息
    private Object data;//返回具体数据


    public Result ok(Object data){
        return new Result(true,"success",data);
    }

    public Result error(){
        return new Result(false,"error",null);
    }

    @Override
    public String toString() {
        return "Result{" +
                "flag=" + flag +
                ", message='" + message + '\'' +
                ", data=" + data +
                '}';
    }

    public boolean isFlag() {
        return flag;
    }

    public void setFlag(boolean flag) {
        this.flag = flag;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public Result() {
    }

    public Result(boolean flag, String message, Object data) {
        this.flag = flag;
        this.message = message;
        this.data = data;
    }
}
